/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.todoterreno.beans;

import org.primefaces.context.RequestContext;
import org.primefaces.model.map.*;

/**
 *
 * @author davex
 */
public class PruebaMapBean {

    private MapModel simpleMapModel;
    
    public PruebaMapBean() {
        simpleMapModel=new DefaultMapModel();
        
        LatLng coord1 = new LatLng(13.706881, -89.21373179999999);
        LatLng coord2 = new LatLng(13.706881, -89.21773379999999);
        LatLng coord3 = new LatLng(13.704881, -89.21773379999999);
        LatLng coord4 = new LatLng(13.704881, -89.21373179999999);
        LatLng coord5 = new LatLng(13.706881, -89.21373179999999);
        
        Polyline polyline = new Polyline();
        polyline.getPaths().add(coord1);
        polyline.getPaths().add(coord2);
        polyline.getPaths().add(coord3);
        polyline.getPaths().add(coord4);
        polyline.getPaths().add(coord5);
          
        polyline.setStrokeWeight(6);
        polyline.setStrokeColor("#FF9900");
        polyline.setStrokeOpacity(0.7);

        simpleMapModel.addOverlay(polyline);
    }
    
    public void caragDialog(){
        RequestContext rc=RequestContext.getCurrentInstance();
        rc.execute("dialog.show()");
    }

    public MapModel getSimpleMapModel() {
        return simpleMapModel;
    }

    public void setSimpleMapModel(MapModel simpleMapModel) {
        this.simpleMapModel = simpleMapModel;
    }
    
    
}
